package com.th.supcom.pds.phamapply.client.service;

import java.util.Date;
import java.util.List;

import net.carefx.framework.container.client.exception.UiException;

import com.extjs.gxt.ui.client.data.PagingLoadConfig;
import com.extjs.gxt.ui.client.data.PagingLoadResult;
import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
import com.th.supcom.pds.phamapply.client.common.InpPhamApplyServiceFactory;
import com.th.supcom.pds.phamapply.client.model.InpPhamApplyDetailModel;
import com.th.supcom.pds.phamapply.client.model.InpPhamApplyDetailSummaryModel;
import com.th.supcom.pds.phamapply.client.model.InpPhamApplyPatInfoModel;

/**
 * InpPhamApplyDetail 服务接口.
 * 
 * 住院摆药请领明细.
 */
@RemoteServiceRelativePath (InpPhamApplyServiceFactory.BASE_URL + "inpPhamApplyDetail.do")
public interface InpPhamApplyDetailRpc extends RemoteService
{

    /**
     * 查询信息.
     * 
     * @param Model
     * @throws UiException 界面异常
     */
    public InpPhamApplyDetailModel getInpPhamApplyDetailById (Long id) throws UiException;

    /**
     * 添加信息.
     * 
     * @param Model
     * @throws UiException 界面异常
     */
    public void addInpPhamApplyDetail (InpPhamApplyDetailModel model) throws UiException;

    /**
     * 修改信息.
     * 
     * @param Model
     * @throws UiException 界面异常
     */
    public void modifyInpPhamApplyDetail (InpPhamApplyDetailModel model) throws UiException;

    /**
     * 删除信息.
     * 
     * @param code
     * @throws UiException 界面异常
     */
    public void removeInpPhamApplyDetail (Long id) throws UiException;

    /**
     * 分页查询信息.
     * 
     * @param config
     * @return
     */
    public PagingLoadResult <InpPhamApplyDetailModel> getInpPhamApplyDetailListWithPaging (PagingLoadConfig config) throws UiException;

    /**
     * 通过护理单元查询在院患者信息
     * 
     * @param nurseUnit
     * @return
     */
    public List <InpPhamApplyPatInfoModel> getInpPhamApplyPatInfos (String nurseUnit) throws UiException;

    /**
     * 查询摆药请领明细
     * 
     * @param inpPatInfoModels 在院患者信息
     * @param nurseUnit 护理单元
     * @param intevalDays 摆药天数
     * @param applicant 请领人
     * @param repetition 长临标识
     * @return
     * @throws UiException
     */
    public List <InpPhamApplyDetailModel> findPhamApplyDetailInfo (List <InpPhamApplyPatInfoModel> inpPatInfoModels, String nurseUnit,
                                                                   Date applyDate, Date endDate, String applicant, String repetition)
                                                                                                                                     throws UiException;

    /**
     * 保存住院患者详情表
     * 
     * @param details
     */
    public void saveInpPhamApplyDetailList (List <InpPhamApplyDetailModel> details, String nurseUnit, Date applyDate, Date endDate, String applicant)
                                                                                                                                        throws UiException;

    /**
     * 获取可冲抵药品信息
     * 
     * @param summaryList
     * @return
     * @throws UiException
     */
    public List <InpPhamApplyDetailModel> getOffsetPhamSummaryList (List <InpPhamApplyDetailSummaryModel> summaryList) throws UiException;

    /** 公司版权信息. */
    public static final String copyright = "Copyright 2014, TH Supcom Corporation";

    /** 提交路径. */
    public static final String SCC_BRANCH = "$URL$";

    /** 提交日期. */
    public static final String SCC_LAST_MODIFICATION_DATE = "$Date$";

    /** 最终修改人员. */
    public static final String SCC_LAST_MODIFIER_NAME = "$Author$";

    /** 最终版本号. */
    public static final String SCC_REVISION = "$Revision$";
}
